#!/usr/bin/env python3
"""Setup script for fuxi-weather package."""

from setuptools import setup, find_packages
import os

# Read the README file for long description
def read_readme():
    """Read README.md file for long description."""
    readme_path = os.path.join(os.path.dirname(__file__), 'README.md')
    if os.path.exists(readme_path):
        with open(readme_path, 'r', encoding='utf-8') as f:
            return f.read()
    return "FuXi Weather: Utility functions for weather and climate data processing"

# Read requirements from requirements.txt
def read_requirements():
    """Read requirements.txt file for dependencies."""
    req_path = os.path.join(os.path.dirname(__file__), 'requirements.txt')
    if os.path.exists(req_path):
        with open(req_path, 'r', encoding='utf-8') as f:
            return [line.strip() for line in f if line.strip() and not line.startswith('#')]
    return []

setup(
    name="fuxi-weather",
    version="0.1.0",
    author="Fan Jiang",
    author_email="cltpys@163.com",  # Replace with your actual email
    description="FuXi Weather: Utility functions for weather and climate data processing",
    long_description=read_readme(),
    long_description_content_type="text/markdown",
    url="https://github.com/fanjiang/fuxi-weather",  # Replace with your actual repository URL
    packages=find_packages(),
    classifiers=[
        "Development Status :: 3 - Alpha",
        "Intended Audience :: Science/Research",
        "License :: OSI Approved :: MIT License",
        "Operating System :: OS Independent",
        "Programming Language :: Python :: 3",
        "Programming Language :: Python :: 3.8",
        "Programming Language :: Python :: 3.9",
        "Programming Language :: Python :: 3.10",
        "Programming Language :: Python :: 3.11",
        "Topic :: Scientific/Engineering :: Atmospheric Science",
        "Topic :: Scientific/Engineering :: GIS",
    ],
    python_requires=">=3.8",
    install_requires=read_requirements(),
    extras_require={
        "gpu": ["cupy"],
        "dev": ["pytest", "black", "flake8", "mypy"],
    },
    keywords="fuxi weather climate meteorology xarray zarr netcdf grib",
    project_urls={
        "Bug Reports": "https://github.com/fanjiang/fuxi-weather/issues",
        "Source": "https://github.com/fanjiang/fuxi-weather",
        "Documentation": "https://github.com/fanjiang/fuxi-weather/blob/main/README.md",
    },
) 